package sort;

/**
 * @author 是阿秋啊
 * @date 2022/03/18 08:58
 **/
public class SortTest {
    public static void main(String[] args) {
        int n = 10000000;
        int m = 10000000;
        int j = 1000000;
        int[] arr = SortHelper.generateRandomArray(n,0,Integer.MAX_VALUE);
        int[] brr = SortHelper.generateSoredArry(m,10);
        //测试重复元素多的情况下
        int[] crr = SortHelper.generateRandomArray(j,0,100);
        int[] crrCopy1 = SortHelper.arrCopy(crr);
        int[] crrCopy2 = SortHelper.arrCopy(crr);
        int[] crrCopy3 = SortHelper.arrCopy(crr);
        int[] crrCopy4 = SortHelper.arrCopy(crr);
        int[] crrCopy5 = SortHelper.arrCopy(crr);
        int[] crrCopy6 = SortHelper.arrCopy(crr);
        int[] crrCopy7 = SortHelper.arrCopy(crr);
        int[] crrCopy8 = SortHelper.arrCopy(crr);
        //测试近乎有序
        int[] brrCopy1 = SortHelper.arrCopy(brr);
        int[] brrCopy2 = SortHelper.arrCopy(brr);
        int[] brrCopy3 = SortHelper.arrCopy(brr);
        int[] brrCopy4 = SortHelper.arrCopy(brr);
        int[] brrCopy5 = SortHelper.arrCopy(brr);
        int[] brrCopy6 = SortHelper.arrCopy(brr);
        int[] brrCopy7 = SortHelper.arrCopy(brr);
        int[] brrCopy8 = SortHelper.arrCopy(brr);
        //测试无序
        int[] arrCopy1 = SortHelper.arrCopy(arr);
        int[] arrCopy2 = SortHelper.arrCopy(arr);
        int[] arrCopy3= SortHelper.arrCopy(arr);
        int[] arrCopy4= SortHelper.arrCopy(arr);
        int[] arrCopy5= SortHelper.arrCopy(arr);
        int[] arrCopy6= SortHelper.arrCopy(arr);
        int[] arrCopy7= SortHelper.arrCopy(arr);
        int[] arrCopy8= SortHelper.arrCopy(arr);
        int[] arrCopy9= SortHelper.arrCopy(arr);
        int[] arrCopy10= SortHelper.arrCopy(arr);
        int[] arrCopy11= SortHelper.arrCopy(arr);
        int[] arrCopy12= SortHelper.arrCopy(arr);
        System.out.println("在无序数组上");
//        SortHelper.testSort("selectionSort",arr);
//        SortHelper.testSort("bubbleSort",arrCopy1);
        SortHelper.testSort("heapSort",arrCopy2);
//        SortHelper.testSort("selectionSortOP",arrCopy3);
//        SortHelper.testSort("insertionSort",arrCopy4);
//        SortHelper.testSort("insertionSortBS",arrCopy5);
        SortHelper.testSort("shellSort",arrCopy6);
        SortHelper.testSort("mergeSort",arrCopy7);
        SortHelper.testSort("mergeSortNonRecursion",arrCopy8);
        SortHelper.testSort("quickSort",arrCopy9);
        SortHelper.testSort("quickSortNonRecursion",arrCopy10);
        SortHelper.testSort("quickSort2",arrCopy11);
        SortHelper.testSort("quickSort3",arrCopy12);
        System.out.println("-----------------------");
        System.out.println("在近乎有序的数组上");
        SortHelper.testSort("heapSort",brrCopy1);
        SortHelper.testSort("shellSort",brrCopy2);
        SortHelper.testSort("mergeSort",brrCopy3);
        SortHelper.testSort("mergeSortNonRecursion",brrCopy4);
        SortHelper.testSort("quickSort",brrCopy5);
        SortHelper.testSort("quickSortNonRecursion",brrCopy6);
        SortHelper.testSort("quickSort2",brrCopy7);
        SortHelper.testSort("quickSort3",brrCopy8);
        System.out.println("-----------------------");
        System.out.println("在重复的数组上");
        SortHelper.testSort("heapSort",crrCopy1);
        SortHelper.testSort("shellSort",crrCopy2);
        SortHelper.testSort("mergeSort",crrCopy3);
        SortHelper.testSort("mergeSortNonRecursion",crrCopy4);
        SortHelper.testSort("quickSort",crrCopy5);
        SortHelper.testSort("quickSortNonRecursion",crrCopy6);
        SortHelper.testSort("quickSort2",crrCopy7);
        SortHelper.testSort("quickSort3",crrCopy8);
    }
}
